Update set what-if handling#1374
Merged
SteveL-MSFT merged 13 commits intoPowerShell:mainfrom Feb 4, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the handling of what-if functionality in DSC by introducing a new whatIfArg parameter within the set block of resource manifests, deprecating the standalone whatIf block, and refactoring argument processing to distinguish between get/test operations and set/delete operations.
Changes:
- Introduces
whatIfArgwithin set/delete blocks to enable native what-if support - Adds deprecation warning for resources using the legacy
whatIfblock and removesWhatIfcapability fromdsc listoutput - Splits
process_args()intoprocess_get_args()andprocess_set_delete_args()to handle different argument types
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/dsctest/dsctest.dsc.manifests.json | Adds test manifest for Test/WhatIfArgKind resource demonstrating new whatIfArg usage |
| lib/dsc-lib/src/extensions/discover.rs | Updates to use process_get_args and GetArgKind type |
| lib/dsc-lib/src/dscresources/resource_manifest.rs | Splits ArgKind into GetArgKind and SetDeleteArgKind, adds WhatIf variant to latter |
| lib/dsc-lib/src/dscresources/command_resource.rs | Refactors argument processing and updates what-if execution logic to check for native support |
| lib/dsc-lib/src/discovery/command_discovery.rs | Removes WhatIf capability from being reported in resource discovery |
| lib/dsc-lib/locales/en-us.toml | Adds deprecation warning message for legacy whatIf operation |
| dsc/tests/dsc_whatif.tests.ps1 | Adds tests for new WhatIfArgKind functionality and synthetic what-if |
| dsc/src/subcommand.rs | Removes WhatIf capability indicator from resource list output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SteveL-MSFT
requested changes
Feb 3, 2026
SteveL-MSFT
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
whatIfArgwithin set block in manifestprocess_args()intoprocess_get_args()andprocess_set_delete_args()PR Context
setanddeleteto support what-if #1361 (delete PR to follow)